import { Component, useState } from 'react'
// ! 每次D都是null的用例

function App() {
  const [num, setnum] = useState(0)
  const arr = new Array(2).fill(0);
  const D = () => <div>C</div>

  return (
    <div className="App" style={{ padding: 80 }} onClick={() => setnum(n => ++n)}>
      {num}
      {arr.map((_, i) => <D key={i} />)}
    </div>
  );
}

export default App;